//
//  PayResultViewController.m
//  YTwallet
//
//  Created by ZhangLin on 2019/4/2.
//  Copyright © 2019年 hadrlog. All rights reserved.
//

#import "PayResultViewController.h"
#import "PayResultView.h"
@interface PayResultViewController ()
@property(nonatomic,strong)PayResultView *pv;

@end

@implementation PayResultViewController

-(void)loadView
{
    [super loadView];
    self.pv = [[PayResultView alloc] initWithFrame:self.view.bounds];
    self.view = self.pv;
}
-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    //隐藏返回按钮
    self.navigationItem.leftBarButtonItem = nil;
    [self.navigationItem setHidesBackButton:YES];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self deleteVC];
    [self.pv.finishedBtn addTarget:self action:@selector(finishedBtnAction) forControlEvents:(UIControlEventTouchUpInside)];
}

-(void)deleteVC
{
    NSMutableArray *array = [self.navigationController.viewControllers mutableCopy];
    //把不需要的页面删除
    NSArray *arrayB = @[@"1",@"2",@"3"];
    for (int j = 0; j < arrayB.count; j++) {
        NSString *a = [arrayB objectAtIndex:j];
        int b = [a intValue] - j;
        [array removeObjectAtIndex:b];
    }
    
    //把删除后的控制器数组再次复制
    [self.navigationController setViewControllers:[array copy]];
}

-(void)finishedBtnAction
{
    NSLog(@"点击完成");
    [self.navigationController popViewControllerAnimated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
